package com.chengqs.rainbow.common.im.util;

import com.chengqs.rainbow.common.core.exception.SystemException;
import com.chengqs.rainbow.common.im.domain.address.AddressInstance;

/**
 * <B>主类名称：</B>AddressUtils<BR>
 * <B>概要说明：</B>enter<BR>
 *
 * @author: chengqs
 * @create: 2025-09-06 23:06:57
 **/
public class AddressUtils {
    public static AddressInstance parseAddress(String address) {
        String[] split = address.split(":");
        if (split.length != 3) {
            throw new SystemException("地址解析错误");
        }
        String serverId = split[0];
        String ip = split[1];
        int port = Integer.parseInt(split[2]);
        return new AddressInstance(serverId, ip, port);
    }
}
